<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: qwt_scale_map.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('qwt__scale__map_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">qwt_scale_map.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Qwt Widget Library</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (C) 1997   Josef Wilgen</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This library is free software; you can redistribute it and/or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;qwt_scale_map.h&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;qwt_math.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;qrect.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;qdebug.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a9576a2e19c0be1d036fee344ab68f542">   21</a></span>&#160;<a class="code" href="class_qwt_scale_map.html#a9576a2e19c0be1d036fee344ab68f542">QwtScaleMap::QwtScaleMap</a>()</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    : m_s1( 0.0 )</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    , m_s2( 1.0 )</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    , m_p1( 0.0 )</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    , m_p2( 1.0 )</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    , m_cnv( 1.0 )</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    , m_ts1( 0.0 )</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    , m_transform( NULL )</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;}</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a579bc766106d98edd7153e62ea77a19b">   33</a></span>&#160;<a class="code" href="class_qwt_scale_map.html#a9576a2e19c0be1d036fee344ab68f542">QwtScaleMap::QwtScaleMap</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; other )</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    : m_s1( other.m_s1 )</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    , m_s2( other.m_s2 )</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    , m_p1( other.m_p1 )</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    , m_p2( other.m_p2 )</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    , m_cnv( other.m_cnv )</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    , m_ts1( other.m_ts1 )</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    , m_transform( NULL )</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;{</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordflow">if</span> ( other.m_transform )</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        m_transform = other.m_transform-&gt;<a class="code" href="class_qwt_transform.html#aae011ee4205fa4391459766d88971809">copy</a>();</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#aecafd09423984a5e0ffa935d1b45110c">   49</a></span>&#160;<a class="code" href="class_qwt_scale_map.html#aecafd09423984a5e0ffa935d1b45110c">QwtScaleMap::~QwtScaleMap</a>()</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">delete</span> m_transform;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a3f55ef14f8874e626380fcf92b096791">   55</a></span>&#160;<a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; <a class="code" href="class_qwt_scale_map.html#a3f55ef14f8874e626380fcf92b096791">QwtScaleMap::operator=</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; other )</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;{</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    m_s1 = other.m_s1;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    m_s2 = other.m_s2;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    m_p1 = other.m_p1;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    m_p2 = other.m_p2;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    m_cnv = other.m_cnv;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    m_ts1 = other.m_ts1;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keyword">delete</span> m_transform;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    m_transform = NULL;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordflow">if</span> ( other.m_transform )</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        m_transform = other.m_transform-&gt;<a class="code" href="class_qwt_transform.html#aae011ee4205fa4391459766d88971809">copy</a>();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#ad8e971dd4be07801f0adc99549153718">   76</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_scale_map.html#ad8e971dd4be07801f0adc99549153718">QwtScaleMap::setTransformation</a>( <a class="code" href="class_qwt_transform.html">QwtTransform</a>* transform )</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;{</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a> != m_transform )</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    {</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keyword">delete</span> m_transform;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        m_transform = <a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    }</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="class_qwt_scale_map.html#aaa33bc8e1aed7aa17d345053194e7094">setScaleInterval</a>( m_s1, m_s2 );</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;}</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a810c561caaad7d6573a1e8ff06fe4b23">   88</a></span>&#160;<span class="keyword">const</span> <a class="code" href="class_qwt_transform.html">QwtTransform</a>* <a class="code" href="class_qwt_scale_map.html#a810c561caaad7d6573a1e8ff06fe4b23">QwtScaleMap::transformation</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordflow">return</span> m_transform;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;}</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#aaa33bc8e1aed7aa17d345053194e7094">  100</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_scale_map.html#aaa33bc8e1aed7aa17d345053194e7094">QwtScaleMap::setScaleInterval</a>( <span class="keywordtype">double</span> s1, <span class="keywordtype">double</span> s2 )</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;{</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    m_s1 = <a class="code" href="class_qwt_scale_map.html#a64b15c76aa63a521447215018c75bf37">s1</a>;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    m_s2 = <a class="code" href="class_qwt_scale_map.html#a7c8c969923c15880c4620be1d814ef18">s2</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">if</span> ( m_transform )</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        m_s1 = m_transform-&gt;<a class="code" href="class_qwt_transform.html#aef97acf17f900905f2a93cec7f61e643">bounded</a>( m_s1 );</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        m_s2 = m_transform-&gt;<a class="code" href="class_qwt_transform.html#aef97acf17f900905f2a93cec7f61e643">bounded</a>( m_s2 );</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    updateFactor();</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a994240e446986112f196a65657dc9755">  119</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_scale_map.html#a994240e446986112f196a65657dc9755">QwtScaleMap::setPaintInterval</a>( <span class="keywordtype">double</span> p1, <span class="keywordtype">double</span> p2 )</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;{</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    m_p1 = <a class="code" href="class_qwt_scale_map.html#a4d03a9fea3bd9b66a0b882b8b1a58f4b">p1</a>;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    m_p2 = <a class="code" href="class_qwt_scale_map.html#acd78b70fae83854a148fa3d08b13c261">p2</a>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    updateFactor();</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;}</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="keywordtype">void</span> QwtScaleMap::updateFactor()</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;{</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    m_ts1 = m_s1;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keywordtype">double</span> ts2 = m_s2;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordflow">if</span> ( m_transform )</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        m_ts1 = m_transform-&gt;<a class="code" href="class_qwt_transform.html#a1093b5856cbc6cf812460535442fb130">transform</a>( m_ts1 );</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        ts2 = m_transform-&gt;<a class="code" href="class_qwt_transform.html#a1093b5856cbc6cf812460535442fb130">transform</a>( ts2 );</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    m_cnv = 1.0;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">if</span> ( m_ts1 != ts2 )</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        m_cnv = ( m_p2 - m_p1 ) / ( ts2 - m_ts1 );</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;}</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#af99eeda829142128f97e0b6c4fbf9e1f">  153</a></span>&#160;QRectF <a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">QwtScaleMap::transform</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; xMap,</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; yMap, <span class="keyword">const</span> QRectF&amp; rect )</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;{</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordtype">double</span> x1 = xMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( rect.left() );</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">double</span> x2 = xMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( rect.right() );</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">double</span> y1 = yMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( rect.top() );</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordtype">double</span> y2 = yMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( rect.bottom() );</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keywordflow">if</span> ( x2 &lt; x1 )</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        qSwap( x1, x2 );</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    <span class="keywordflow">if</span> ( y2 &lt; y1 )</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        qSwap( y1, y2 );</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">if</span> ( qwtFuzzyCompare( x1, 0.0, x2 - x1 ) == 0 )</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        x1 = 0.0;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">if</span> ( qwtFuzzyCompare( x2, 0.0, x2 - x1 ) == 0 )</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        x2 = 0.0;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">if</span> ( qwtFuzzyCompare( y1, 0.0, y2 - y1 ) == 0 )</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        y1 = 0.0;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">if</span> ( qwtFuzzyCompare( y2, 0.0, y2 - y1 ) == 0 )</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        y2 = 0.0;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">return</span> QRectF( x1, y1, x2 - x1 + 1, y2 - y1 + 1 );</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;}</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a08dc05a17283c531e2c1d79fd52bc56a">  187</a></span>&#160;QPointF <a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">QwtScaleMap::invTransform</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; xMap,</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; yMap, <span class="keyword">const</span> QPointF&amp; pos )</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;{</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keywordflow">return</span> QPointF(</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        xMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( pos.x() ),</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        yMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( pos.y() )</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        );</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;}</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a6be600afa5bd75f5ff52b1f102b123b0">  206</a></span>&#160;QPointF <a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">QwtScaleMap::transform</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; xMap,</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; yMap, <span class="keyword">const</span> QPointF&amp; pos )</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;{</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordflow">return</span> QPointF(</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        xMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( pos.x() ),</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        yMap.<a class="code" href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">transform</a>( pos.y() )</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        );</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;}</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="class_qwt_scale_map.html#a8fe572f224a14672684fd929c55568f8">  224</a></span>&#160;QRectF <a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">QwtScaleMap::invTransform</a>( <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; xMap,</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; yMap, <span class="keyword">const</span> QRectF&amp; rect )</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;{</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> x1 = xMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( rect.left() );</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> x2 = xMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( rect.right() - 1 );</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> y1 = yMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( rect.top() );</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> y2 = yMap.<a class="code" href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">invTransform</a>( rect.bottom() - 1 );</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <span class="keyword">const</span> QRectF r( x1, y1, x2 - x1, y2 - y1 );</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span class="keywordflow">return</span> r.normalized();</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;}</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160; </div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="preprocessor">#ifndef QT_NO_DEBUG_STREAM</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;QDebug operator&lt;&lt;( QDebug debug, <span class="keyword">const</span> <a class="code" href="class_qwt_scale_map.html">QwtScaleMap</a>&amp; map )</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;{</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    debug.nospace() &lt;&lt; <span class="stringliteral">&quot;QwtScaleMap(&quot;</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                    &lt;&lt; map.<a class="code" href="class_qwt_scale_map.html#a810c561caaad7d6573a1e8ff06fe4b23">transformation</a>()</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;                    &lt;&lt; <span class="stringliteral">&quot;, s:&quot;</span> &lt;&lt; map.<a class="code" href="class_qwt_scale_map.html#a64b15c76aa63a521447215018c75bf37">s1</a>() &lt;&lt; <span class="stringliteral">&quot;-&gt;&quot;</span> &lt;&lt; map.<a class="code" href="class_qwt_scale_map.html#a7c8c969923c15880c4620be1d814ef18">s2</a>()</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                    &lt;&lt; <span class="stringliteral">&quot;, p:&quot;</span> &lt;&lt; map.<a class="code" href="class_qwt_scale_map.html#a4d03a9fea3bd9b66a0b882b8b1a58f4b">p1</a>() &lt;&lt; <span class="stringliteral">&quot;-&gt;&quot;</span> &lt;&lt; map.<a class="code" href="class_qwt_scale_map.html#acd78b70fae83854a148fa3d08b13c261">p2</a>()</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                    &lt;&lt; <span class="stringliteral">&quot;)&quot;</span>;</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    <span class="keywordflow">return</span> debug.space();</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;}</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_qwt_scale_map_html"><div class="ttname"><a href="class_qwt_scale_map.html">QwtScaleMap</a></div><div class="ttdoc">A scale map.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00026">qwt_scale_map.h:27</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a3f55ef14f8874e626380fcf92b096791"><div class="ttname"><a href="class_qwt_scale_map.html#a3f55ef14f8874e626380fcf92b096791">QwtScaleMap::operator=</a></div><div class="ttdeci">QwtScaleMap &amp; operator=(const QwtScaleMap &amp;)</div><div class="ttdoc">Assignment operator.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00055">qwt_scale_map.cpp:55</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a4d03a9fea3bd9b66a0b882b8b1a58f4b"><div class="ttname"><a href="class_qwt_scale_map.html#a4d03a9fea3bd9b66a0b882b8b1a58f4b">QwtScaleMap::p1</a></div><div class="ttdeci">double p1() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00099">qwt_scale_map.h:99</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a504f1627e0e02ddac03d2ce46507b865"><div class="ttname"><a href="class_qwt_scale_map.html#a504f1627e0e02ddac03d2ce46507b865">QwtScaleMap::transform</a></div><div class="ttdeci">double transform(double s) const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00137">qwt_scale_map.h:137</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a64b15c76aa63a521447215018c75bf37"><div class="ttname"><a href="class_qwt_scale_map.html#a64b15c76aa63a521447215018c75bf37">QwtScaleMap::s1</a></div><div class="ttdeci">double s1() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00083">qwt_scale_map.h:83</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a7c8c969923c15880c4620be1d814ef18"><div class="ttname"><a href="class_qwt_scale_map.html#a7c8c969923c15880c4620be1d814ef18">QwtScaleMap::s2</a></div><div class="ttdeci">double s2() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00091">qwt_scale_map.h:91</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a810c561caaad7d6573a1e8ff06fe4b23"><div class="ttname"><a href="class_qwt_scale_map.html#a810c561caaad7d6573a1e8ff06fe4b23">QwtScaleMap::transformation</a></div><div class="ttdeci">const QwtTransform * transformation() const</div><div class="ttdoc">Get the transformation.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00088">qwt_scale_map.cpp:88</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a9576a2e19c0be1d036fee344ab68f542"><div class="ttname"><a href="class_qwt_scale_map.html#a9576a2e19c0be1d036fee344ab68f542">QwtScaleMap::QwtScaleMap</a></div><div class="ttdeci">QwtScaleMap()</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00021">qwt_scale_map.cpp:21</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_a994240e446986112f196a65657dc9755"><div class="ttname"><a href="class_qwt_scale_map.html#a994240e446986112f196a65657dc9755">QwtScaleMap::setPaintInterval</a></div><div class="ttdeci">void setPaintInterval(double p1, double p2)</div><div class="ttdoc">Specify the borders of the paint device interval.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00119">qwt_scale_map.cpp:119</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_aaa33bc8e1aed7aa17d345053194e7094"><div class="ttname"><a href="class_qwt_scale_map.html#aaa33bc8e1aed7aa17d345053194e7094">QwtScaleMap::setScaleInterval</a></div><div class="ttdeci">void setScaleInterval(double s1, double s2)</div><div class="ttdoc">Specify the borders of the scale interval.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00100">qwt_scale_map.cpp:100</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_ab1ee6d62addf3f9cf091d425be9ac642"><div class="ttname"><a href="class_qwt_scale_map.html#ab1ee6d62addf3f9cf091d425be9ac642">QwtScaleMap::invTransform</a></div><div class="ttdeci">double invTransform(double p) const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00154">qwt_scale_map.h:154</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_acd78b70fae83854a148fa3d08b13c261"><div class="ttname"><a href="class_qwt_scale_map.html#acd78b70fae83854a148fa3d08b13c261">QwtScaleMap::p2</a></div><div class="ttdeci">double p2() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8h_source.html#l00107">qwt_scale_map.h:107</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_ad8e971dd4be07801f0adc99549153718"><div class="ttname"><a href="class_qwt_scale_map.html#ad8e971dd4be07801f0adc99549153718">QwtScaleMap::setTransformation</a></div><div class="ttdeci">void setTransformation(QwtTransform *)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00076">qwt_scale_map.cpp:76</a></div></div>
<div class="ttc" id="aclass_qwt_scale_map_html_aecafd09423984a5e0ffa935d1b45110c"><div class="ttname"><a href="class_qwt_scale_map.html#aecafd09423984a5e0ffa935d1b45110c">QwtScaleMap::~QwtScaleMap</a></div><div class="ttdeci">~QwtScaleMap()</div><div class="ttdef"><b>Definition:</b> <a href="qwt__scale__map_8cpp_source.html#l00049">qwt_scale_map.cpp:49</a></div></div>
<div class="ttc" id="aclass_qwt_transform_html"><div class="ttname"><a href="class_qwt_transform.html">QwtTransform</a></div><div class="ttdoc">A transformation between coordinate systems.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__transform_8h_source.html#l00035">qwt_transform.h:36</a></div></div>
<div class="ttc" id="aclass_qwt_transform_html_a1093b5856cbc6cf812460535442fb130"><div class="ttname"><a href="class_qwt_transform.html#a1093b5856cbc6cf812460535442fb130">QwtTransform::transform</a></div><div class="ttdeci">virtual double transform(double value) const =0</div></div>
<div class="ttc" id="aclass_qwt_transform_html_aae011ee4205fa4391459766d88971809"><div class="ttname"><a href="class_qwt_transform.html#aae011ee4205fa4391459766d88971809">QwtTransform::copy</a></div><div class="ttdeci">virtual QwtTransform * copy() const =0</div><div class="ttdoc">Virtualized copy operation.</div></div>
<div class="ttc" id="aclass_qwt_transform_html_aef97acf17f900905f2a93cec7f61e643"><div class="ttname"><a href="class_qwt_transform.html#aef97acf17f900905f2a93cec7f61e643">QwtTransform::bounded</a></div><div class="ttdeci">virtual double bounded(double value) const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__transform_8cpp_source.html#l00033">qwt_transform.cpp:33</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>qwt_scale_map.cpp</b></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
